<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>phc -- Developers</title>
		<link rel="stylesheet" type="text/css" href="phc.css">
	</head>
	<body>
		<table width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td class=grey><img src="img/header.png" alt="phc logo"></td>
		</tr>
		<tr>
			<td class=linkbar>
				<a href="index.html">Home</a> | 
				<a href="downloads.html">Download <span class=phc>phc</span></a> | 
				<a href="documentation.html">Documentation</a> | 
				<a href="contribute.html">Developers and Contributors</a> |
				<a href="mailinglist.html">Mailing List</a> |
			</td>
		</tr>
		</table>
		<table class=maintable>
		<tr>
			<td>

			<h1>Contributing to <span class=phc>phc</span></h1>

			<h2>Getting Involved</h2>

				<p>The simplest way of getting involved is to pick a simple task to do. There are two ways of doing this:
					<ul>
						<li>Running the test suite, and seeing what fails. <strong>(This is probably the best way)</strong>.</li>

						<li>
							Picking a task marked
							<a href="http://code.google.com/p/phc/issues/list?can=2&q=difficulty%3DTrivial">Trivial</a>
							or
							<a href="http://code.google.com/p/phc/issues/list?can=2&q=difficulty%3DEasy">Easy</a>
							in the 
							<a href="http://code.google.com/p/phc/issues/list">Bug tracker</a>.
						</li>

					</ul>

					Feel free to ask questions on the mailing list.
				</p>

			<h3>Getting started:</h3>

				<p>The documentation page lists a few talks and papers that give
				overviews of 
				<a href="http://www.youtube.com/watch?v=kKySEUrP7LA">the whole compiler</a>,
				<a	href="https://www.cs.tcd.ie/publications/tech-reports/reports.07/TCD-CS-2007-47.pdf">the front-end</a> 
				and 
				<a href="https://www.cs.tcd.ie/~pbiggar/sac-2009.pdf">the back-end</a>.

				<p>The 
				<a href="http://www.phpcompiler.org/doc/latest/manual.html">manual</a>
				describes how most <span class=phc>phc</span> passes, which are
				either visitors or transforms, work. Other passes are typically
				once-off, and the code is the documentation. If there is any code
				where the intent and function of the code is not clear from the
				code or documentation, please bring it to our attention, and we
				will explain it.</p>


			<h2>What to contribute</h2>

				<p>The following list describes what you can do with your particular skills:</p>

			<ul>
				<li>
					<h3>C / Zend API:</h3>

						<p>If you're familiar with the Zend API, the most important
						work we need completed is code generation. We currently don't
						support PHP's OO features in our compiled code, and this is
						probably our highest priority.</p>

						<p>After building <span class="phc">phc</span>, run <i>make
						test</i>. Programs which need code generation support can be
						examined in <i>test/logs/latest/Generate_C</i>.</p>

				</li>
				<li>
					<h3>C++:</h3>

						<p>The compiler is written in C++, and most changes require some
						C++. Fortunately, most of the C++ we use is simple, and the
						only exceptions (templates) are relatively rare. A good way
						to find things to do is to grep the current sources for
						<i>TODO</i> comments. See also the previous section.

				</li>
				<li>
					<h3>C:</h3>

						<p>Some important parts of the compiler are written in C,
						such as the parser and lexer. We have a number of
						parser/unparser bugs, which mostly need to be solved in the
						parser. Knowledge of flex/bison is useful for solving
						these.</p>


						<p>If you know C, perhaps you'd like to look at code
						generation. Even if you arent familiar with the Zend API,
						you can learn it by:
						</p>
							<ul>
								<li>reading the current C code which <span class=phc>phc</span> generates</li>
								<li>reading the PHP sources (in the Zend folder)</li>
								<li><a href="http://www.amazon.com/Extending-Embedding-PHP-Developers-Library/dp/067232704X">Extending and Embedding PHP</a>, by Sara Golemon</li>
								<li><a href="http://www.zapt.info/PHPOpcodes_Sep2008.odp">Detailed presentation of the Zend Engine in PHP 5.2</a>
								<li><a href="http://talks.php.net/index.php/Internals">Presentations</a> about PHP internals (and <a href="http://talks.somabo.de/20080721.pdf">another</a>)</li>
								
								<li>PHP internals articles
										(<a href="http://devzone.zend.com/node/view/id/1021">1</a>,
										<a href="http://www.trickie.org/code/zend_engine_two/">2</a>)
								</li>
							</ul>
				</li>
				<li>
					<h3>PHP:</h3>

						<p>Our test framework needs a lot of love. The most important
						fix is to support the PHPT tests from PHP.</p>

						<p>We have a test bot (see <a
						href="http://code.google.com/p/phc/source/browse/trunk/test/framework/records">test/framework/records</a>),
						that checks out each version from our repository, builds it,
						tests it, and records the results. Issue 61 details a number
						of changes we'd like to more fully test each revision.</p>

				</li>
				<li>
					<h3>Haskell:</h3>

						<p>Most of <span class=phc>phc</span> is run on code generated by
						our other project, <a
						href="http://code.google.com/p/maketea/">maketea</a>. Bugs labeled
						as <i>Maketea</i> should be fixed within maketea (though we use
						<span class=phc>phc</span>'s mailing list for this).</p>
				</li>
				<li>
					<h3>Autotools/Makefiles:</h3>

						<p>The issues list a number of bugs in our autotools files. If
						you have experience with autoconf, automake, libtool and
						make, it should not be difficult to fix these.</p>
				</li>
				<li>
					<h3>Packagers:</h3>

						<p>We'd like <span class=phc>phc</span> to be available
						through package managers, rather than requiring people to
						download and compile the source.</p>
				</li>
				<li>
					<h3>Webmaster:</h3>

					<p>If you're interested in being our webmaster, please get in touch.</p>
				</li>
			</ul>



			<h3>Bug reports:</h3>

				<p>Please report bugs directly to the phc-general list. We can
				update the issue tracker from there. The list archives may provide
				hints to you, but you should feel free to contact us.</p>

				<p>After seeing real bugs, we generally fix them on the spot. Bugs
				which we cannot fix immediately, we add to our bug database.</p>

				<p>If you have a program which shows the bug, that would be
				incredibly helpful. If you are able to fix the bug, please send us
				patches. We will verify them and apply them (and add your name to
				the contributors list). If your program is too long to send as a
				bug report, our test suite includes the <a
				href="http://code.google.com/p/phc/source/browse/trunk/test/framework/reduce">reduce</a>
				script. This automatically reduces your program by removing
				statements from it, but keeps the bug intact.  It has in the past
				been useful for reducing test cases, and may be useful for you.</p>


			<h3>Mailing lists:</h3>

				<p>phc-general is for questions where most users of the <span
				class=phc>phc</span> may be interested in the response.
				phc-internals is for questions where only the developers and
				contributors would be interested. It also receives an email for
				each bug update and svn commit. If you are unsure of the proper
				place to send your email, don't worry about it, and try the
				phc-general list. There will be a friendly response there.</p>



			<h2><a name=contributors>Authors and Contributors</a></h2>

				<p>
          <span class=phc>phc</span> was started in 2005 by Edsko de Vries and
          John Gilbert. Paul Biggar joined after version 0.1.7 and currently
          maintains <span class="phc">phc</span>, as well as spending an awful
          lot of time on the experimental <i>dataflow</i> branch; Edsko works
          on code generation and is currently adding support for object
          oriented features. 
				</p>

				<p>
					In addition, the following list (alphabetically by first name)
					of people have contributed to <span class="phc">phc</span>:

					Alexey Zakhlestin,
					Andras Biczo, 
					Andreas Korthaus,
					Atanas Beloborodov,
					Conor McDermottroe, 
					Daniel Barreiro,
					Daniel Fabian, 
					Dan Libby,
					David Abrahamson, 
					Eric Bouwers,
					Jakub Suchy,
					Johan B.W. de Vries,
					Lorenzo Bettini,
					Marc Eisenbarth, 
					Matthias Kleine,
					Mike Dupont,
					Ryan Stutsman,
					Sven Klemm,
					Tim Van Holder.
				</p>

			</td>
			<td valign=top width="15%" align=center>
				<table class=devel_links>
					<tr><th><h1>Developer links</h1></th></tr>
					<tr><td><hr /></td></tr>

					<tr><td><a href="mailinglist.html">Join phc mailing lists</a></td></tr>
					<tr><td><a href="lists/phc-internals/">phc-internals archives</a></td></tr>
					<tr><td><a href="lists/phc-general/">phc-general archives</a></td></tr>

					<tr><td><hr /></td></tr>

					<tr><td><a href="doc/latest/manual.html#developers-manual">Developer documentation</a></td></tr>
					<tr><td><a href="doc/latest/manual.html#users-manual">User documentation</a></td></tr>

					<tr><td><hr /></td></tr>

					<tr><td><a href="http://code.google.com/p/phc/">Project page</a></td></tr>
					<tr><td><a href="http://code.google.com/p/phc/w/list">Wiki</a></td></tr>
					<tr><td><a href="http://code.google.com/p/phc/issues/list">Issue tracker</a></td></tr>
					<tr><td><a href="http://code.google.com/p/phc/source/checkout">SVN repository</a></td></tr>
				</table>

			</td>
		</tr>
		</table>
		<table class=linkbar>
			<tr><td>$LastChangedDate: 2009-12-15 02:23:00 +0000 (Tue, 15 Dec 2009) $.</td></tr>
		</table>
		<script type="text/javascript">
		var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
		document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
		</script>
		<script type="text/javascript">
			var pageTracker = _gat._getTracker("UA-1942036-1");
			pageTracker._trackPageview();
		</script>
	</body>
</html>
